#ifndef __SOUND_H__
#define __SOUND_H__

#pragma comment(lib,"fmodex_vc.lib")

#include <stdio.h>

#include "cLog.h"
#include "cPersonaje.h"
#include "cEnemyManager.h"

#include <fmod.hpp>

class cAudioLayer
{
public:
	cAudioLayer(void);
	~cAudioLayer(void);

public:
	bool Init();
	void Finalize();

	bool LoadData();
	void UnLoadData();

	bool LoopMusic();
	bool LoopSounds(cPersonaje* Player, cEnemyManager* EnemyManager);

private:
	FMOD::System *m_System;

	FMOD::Sound *m_soundMain;
	FMOD::Channel *m_channelMain;

	FMOD::Sound *m_sDragonWarCry;

	FMOD::Sound *m_sDragonFist;
	FMOD::Channel *m_cDragonFist;

	FMOD::Sound *m_sDragonHit;
	FMOD::Channel *m_cDragonHit;

	FMOD::Sound *m_sDragonDie;
	FMOD::Channel *m_cDragonDie;

	FMOD::Sound *m_sSword;
	FMOD::Channel *m_cSword;

	FMOD::Sound *m_sManScream;
	FMOD::Channel *m_cManScream;

	FMOD_RESULT LoopPlayer(cPersonaje* Player);
	FMOD_RESULT LoopEnemies(cEnemyManager* Player);
	void Play(FMOD::Sound* sound, FMOD::Channel** channel);
	void Play(FMOD::Sound* sound);
};

#endif

